import { Pagination, Table, Drawer, message } from 'antd';
import React, { useRef, useState,useEffect } from 'react';
import type { PaginationProps } from 'antd';
import styles from './index.less'
interface Props{
  columns?: any;
  dataSource?:any[];
  pagination?:PaginationProps;
}
const TableList: React.FC<Props> = (props:Props) => {
  return (
    <div style={{background:'#fff',padding:'24px'}}>
      <div>
        <Table 
          rowKey='id'
          {...props}
          pagination={false}
        />
      </div>
      <div className={styles.pageBox}>
        {props.pagination?<Pagination
          showSizeChanger={true}
          pageSizeOptions={[10, 20, 50, 100]}
        {...props.pagination} />:null}
      </div>
    </div>
  );
};

export default TableList;
